
/**
 * @author 帅小伙
 * @date 2022/1/2
 * @description
 */
public class Worker03 {




    public static void main(String[] args) throws Exception {

        Consumer3 consumer = new Consumer3();

        for (int i = 0; i < 2; i++) {
            final int sleep = i;
            new Thread(()->{
                try {
                    consumer.consume(1-sleep);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            },"ah"+i).start();
        }
    }
}

